using Microsoft.Extensions.DependencyInjection;
using MVVM.NotifyPropertyChanged.Container;
using MVVM.NotifyPropertyChanged.Services;
using MVVM.NotifyPropertyChanged.ViewModels;
using MVVM.NotifyPropertyChanged.Views;

namespace MVVM.NotifyPropertyChanged
{
    internal static class Program
    {
        [STAThread]
        static void Main()
        {
            var serviceProvider = ServicesContainer.Configure();
            ApplicationConfiguration.Initialize();

            var loginViewModel = serviceProvider.GetService<LoginViewModel>();
            var loginForm = new LoginView(loginViewModel);

            serviceProvider.GetService<DatabaseInitializer>()?.InitializeDatabase();
            Application.Run(loginForm);
        }
    }
}